import GameManager from "./GameManager";
import { End } from "./Gwx/Ending";

const { ccclass, property } = cc._decorator;
export enum SharkSayType {
    吃苹果 = "吃苹果",
    吊胃口 = "吊胃口",
    举哑铃 = "举哑铃",
    睡觉 = "睡觉",
    最终结局 = "最终结局",
    害怕 = "害怕",
}

@ccclass
export default class SharkSayManager extends cc.Component {

    public static GetSharkSayDate(sharksaytype: SharkSayType): number[] {
        let Data: number[] = [];
        let data = GameManager.Instance.sharkData;
        if (sharksaytype == SharkSayType.吃苹果) {
            switch (data[0]) {
                case 1: Data = [4, 5]; break;
                case 2: Data = [6]; break;
                case 3: Data = [7, 9]; break;
                case 4: Data = [8]; break;
                case 5: Data = [10]; break;
                case 6: Data = [11]; break;
                case 7: Data = [12]; break;
                case 8: Data = [13, 14]; break;
                case 9: Data = [15]; break;
                case 10: Data = [16, 17, 18]; break;
            }

        }
        if (sharksaytype == SharkSayType.举哑铃) {
            switch (data[1]) {
                case 1: Data = [42]; break;
                case 2: Data = [75]; break;
                case 3: Data = [76]; break;
                case 4: Data = [77]; break;
                case 5: Data = [78]; break;
                case 6: Data = [79]; break;
                case 7: Data = [80]; break;
                case 8: Data = [81]; break;
                case 9: Data = [82, 83]; break;
            }

        }
        if (sharksaytype == SharkSayType.睡觉) {
            switch (data[2]) {
                case 1: Data = [84]; break;
                case 2: Data = [85, 86]; break;
                case 3: Data = [87, 88]; break;
                case 4: Data = [89]; break;
                case 5: Data = [90]; break;
                case 6: Data = [91]; break;
                case 7: Data = [92]; break;
            }

        }
        if (sharksaytype == SharkSayType.吊胃口) {
            switch (GameManager.Instance.Tantalizeindex) {
                case 0: Data = [26]; break;
                case 1: Data = [27]; break;
                case 2: Data = [28, 29]; break;
                case 3: Data = [30, 31]; break;
                case 4: Data = [32]; break;
                case 5: Data = [33]; break;
                case 6: Data = [34]; break;
                case 7: Data = [35]; break;
                case 8: Data = [36, 37]; break;
                case 9: Data = [38, 39]; break;
                case 10: Data = [40, 149]; break;
                case 11: Data = [41]; break;
            }
        }
        if (sharksaytype == SharkSayType.害怕) {
            switch (GameManager.Instance.fearindex) {
                case 0: Data = [44, 45]; break;
                case 1: Data = [46, 47]; break;
                case 2: Data = [48, 49]; break;
                case 3: Data = [50]; break;
                case 4: Data = [51]; break;
                case 5: Data = [52]; break;
                case 6: Data = [53, 54]; break;
                case 7: Data = [55]; break;
                case 8: Data = [56, 57]; break;
                case 9: Data = [58, 59, 60, 61]; break;
                case 10: Data = [62, 63, 64, 65, 66, 67]; break;
            }
        }

        if (sharksaytype == SharkSayType.最终结局) {
            if (GameManager.SharkHurted) {
                //伤害过小鲨鱼
                Data = [127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
                    141, 142, 143, 144, 145, 146, 147, 148, 149];
            }
            else {
                Data = [127, 128, 129, 130, 131, 132, 150, 151, 152, 153, 154, 155, 156, 157,
                    158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173]
            }

        }

        return Data;
    }
}
